import Vue from 'vue'
import vuex from 'vuex'
Vue.use(vuex);
export default new vuex.Store({
	namespaced: true,
    state:{
		theme:''
	},
    mutations: {
        addTheme (state,theme) {
            state.theme = theme
        },
    },
    getters:{
    
    },
    actions:{//类似vue的methods
        changeTheme(context,theme){//接收一个与store实例具有相同方法的属性的context对象
            context.commit("addTheme",theme);
        }
    }
})
